/**
*      author: Y_Yao
*      created: 2025-04-10 10:22:40
**/

#include<bits/stdc++.h>

#define int LL
using namespace std;
using LL = long long;
const LL LLINF = 9e18;
const int INF = 0x3f3f3f3f;
string s;
vector<string> v;

void solve()
{
    cin >> s;
    v.push_back("dreamer");
    v.push_back("eraser");
    v.push_back("erase");
    v.push_back("dream");
    int n = s.size();
    s = " " + s;
    int i = n;
    while(i >= 1)
    {
        bool flag = false;
        
        for(auto& e : v)
        {
            int len = e.size(); 
            // cout << len << endl;
            if(i >= len - 1)
            {
                string t = s.substr(i - len + 1,len);
                if(t == e)
                {
                    i -= len;
                    flag = true;
                    break;
                }
            }
        }

        if(flag == false)
        {
            cout << "NO" << endl;
            return;
        }
    }
    cout << "YES" << endl;;
}

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    int t = 1;
    // cin >> t;
    while(t--)
    {
        solve();
    }
    return 0;
}